package com.hd.hdxgddcommon.entity.dto;

import com.hd.hdxgddcommon.constant.ResultConst;
import lombok.Data;

@Data
public class IdcHttpDto<T> {
    private int code;
    private String msg;
    private T data;

    public IdcHttpDto(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public IdcHttpDto(int code) {
        this.code = code;
    }

    public IdcHttpDto(int code, T data) {
        this.data = data;
        this.code = code;
    }

    public IdcHttpDto(int code, String msg) {
        this.msg = msg;
        this.code = code;
    }

    public IdcHttpDto(ResultConst resultConst) {
        this(resultConst.getCode(), resultConst.getMsg());
    }

    public IdcHttpDto(ResultConst resultConst, String msg, T data) {
        this(resultConst.getCode(), msg, data);
    }

    public IdcHttpDto(ResultConst resultConst, T data) {
        this(resultConst.getCode(), resultConst.getMsg(), data);
    }
}
